<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:69:"D:\wamp\www\TP5\tp5\public/../application/index\view\Login\login.html";i:1527836902;}*/ ?>
<!DOCTYPE html>
<html>

	<head lang="en">
		<meta charset="UTF-8">
		<title>登录</title>
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
		<meta name="format-detection" content="telephone=no">
		<meta name="renderer" content="webkit">
		<meta http-equiv="Cache-Control" content="no-siteapp" />

		<link rel="stylesheet" href="/static/home/AmazeUI-2.4.2/assets/css/amazeui.css" />
		<link href="/static/home/css/dlstyle.css" rel="stylesheet" type="text/css">
		<script src="/static/home/AmazeUI-2.4.2/assets/js/jquery.min.js"></script>
		<script src="/static/home/AmazeUI-2.4.2/assets/js/amazeui.min.js"></script>
	</head>

	<body>

		<div class="login-boxtitle">
			<a href="home.html"><img alt="logo" src="/static/home/images/aishang.png" /></a>
		</div>

		<div class="login-banner">
			<div class="login-main">
				<div class="login-banner-bg"><span></span><img src="/static/home/images/big.jpg" /></div>
				<div class="login-box">

					<h3 class="title">登录商城</h3>

					<div class="clear"></div>
						
					<div class="login-form">
						<form method = "post" action="/homelogin/dologin" id="form">
							<div class="user-name">
								<label for="user"><i class="am-icon-user"></i></label>
								<input type="text" name="tel" id="user" placeholder="手机">
                			</div>
                			<div class="user-pass">
								<label for="password"><i class="am-icon-lock"></i></label>
								<input type="password" name="password" id="password" placeholder="请输入密码">
                			</div>
                			<div class="am-cf">
								<input type="submit" name="btn" value="登 录" class="am-btn am-btn-primary am-btn-sm">
							</div>
              			</form>
           			</div>
            
            		<div class="login-links">
						<a href="/homelogin/find" class="am-fr">忘记密码</a>
						<a href="/homeregister/register" class="zcnext am-fr am-btn-default">注册</a>
						<br />
            		</div>
								
					<div class="partner">		
						<h3>合作账号</h3>
						<div class="am-btn-group">
							<li><a href="#"><i class="am-icon-qq am-icon-sm"></i><span>QQ登录</span></a></li>
							<li><a href="#"><i class="am-icon-weibo am-icon-sm"></i><span>微博登录</span> </a></li>
							<li><a href="#"><i class="am-icon-weixin am-icon-sm"></i><span>微信登录</span> </a></li>
						</div>
					</div>	
				</div>
			</div>
	<div class="footer "> 
    	<div class="footer-hd "> 
    	<p> 
        <span>友情链接</span> 
        <?php if(is_array($links) || $links instanceof \think\Collection || $links instanceof \think\Paginator): if( count($links)==0 ) : echo "" ;else: foreach($links as $key=>$links): ?>
          <a href="http://<?php echo $links['linksaddress']; ?>" target="_blank"><?php echo $links['linksname']; ?></a> <b>|</b>
        <?php endforeach; endif; else: echo "" ;endif; ?> 
    	</p> 
    </div> 
    <div class="footer-bd "> 
      <p>
	      <a href="# ">关于爱上零食屋</a>&nbsp&nbsp&nbsp&nbsp&nbsp 
	      <a href="# ">合作伙伴</a>&nbsp&nbsp&nbsp&nbsp&nbsp  
	      <a href="# ">联系我们</a>
      </p> 
     </div> 
    </div> 
   </div> 
  </div> 
</div>
</body>
</html>
<script type="text/javascript">
	TEL = false;
	PASSWORD = false;
	$("input[name='tel']").blur(function(){
		//获取手机号码
		tel=$(this).val();
		// 正则匹配
		// alert(tel);
		if(tel.match(/^1[34578]\d{9}$/)==null){
			TEL = false;
			alert("手机号码格式不符合");
		}else{
			//检测手机号码是否存在
			//ajax
			$.get("/homelogin/checktel",{tel:tel},function(data){
				if(data==0){
					TEL = false;
					//号码已经存在
					alert("号码未注册");
				}else{
					TEL = true;
				}
			});
		}
	});
	//检测密码
	$("input[name='password']").blur(function(){
		//获取密码
		password=$(this).val();
		// 正则匹配
		// alert(1);
		if(password.length==0){
			PASSWORD = false;
			alert("请输入密码");
		}else{
			PASSWORD=true
		}
	});
	//表单提交事件
	$("#form").submit(function(){
		if(TEL && PASSWORD){
			return true;
		}else{
			alert("请输入登录信息")
			return false;
		}
	});
</script>
